//
//  JSKitManager.h
//  NiubilityProject
//
//  Created by Apple on 2018/5/9.
//  Copyright © 2018年 Apple. All rights reserved.
/*
 1.字符串转换为 价格 xx.xx -> @“¥”是否显示¥
 2.添加字符串 toFront or toBack 添加到字符串前面还是后面
 3.时间转时间戳
 4.时间戳转时间
 
 // 富文本
 1.设置图片
 
 */

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class JSKitManager;

/*! 记录当前调用mark时的当前值 【manager.originalVar】 */
typedef JSKitManager *(js_mark)(void);

/*! string */
typedef JSKitManager *(^js_addSting)(NSString *);



/*! NSMutableAttributedString */
typedef JSKitManager *(^js_changeAttributed)(NSDictionary *attriDic, NSRange range); // 设置富文本样式
typedef JSKitManager *(^js_attributedCorlorRange)(UIColor  *color, NSRange range);
typedef JSKitManager *(^js_attributedFontRange)(UIFont *font, NSRange range);
typedef JSKitManager *(^js_attributedObliquenessRange)(NSNumber *number, NSRange range); // 设置倾斜度
/*! 设置文字排版方向，取值为 NSNumber 对象(整数)，0 表示横排文本，1 表示竖排文本 */
typedef JSKitManager *(^js_attributedVerticalGlyphRange)(NSNumber *value, NSRange range);
/*! 设置文字书写方向，从左向右书写或者从右向左书写 */
typedef JSKitManager *(^js_changeWritingDirection)(NSWritingDirection style, NSRange range);
/*! 设置下划线样式：根据枚举选择 */
typedef JSKitManager *(^js_changeUnderline)(NSUnderlineStyle style, UIColor *color, NSRange range);
/*! 全部添加删除线 设置删除线样式：根据枚举选择 */
typedef JSKitManager *(^js_changeUnderlineAtAll)(NSUnderlineStyle style, UIColor *color);
/*! 设定字符间距，取值为 NSNumber 对象（整数），正值间距加宽，负值间距变窄  */
typedef JSKitManager *(^js_changeKern)(NSNumber *value, NSRange range);
/*! 根据位置设置文本横向拉伸属性，取值为 NSNumber （float）,正值横向拉伸文本，负值横向压缩文本 */
typedef JSKitManager *(^js_changeExpansion)(NSNumber *value, NSRange range);
/*! 根据位置添加阴影效果 */
typedef JSKitManager *(^js_changeShadow)(NSShadow *shadow, NSRange range);
/*! 根据位置修改描边颜色 */
typedef JSKitManager *(^js_changeStrokeColor)(UIColor *strokeColor,NSNumber *strokeWidth, NSRange range);
/*! 插入图片到指定位置 */
typedef JSKitManager *(^js_appendAttachText)(UIView *atteach, NSInteger atIndex);


/*! text attr */
typedef JSKitManager *(^js_sting)(NSString *);
typedef JSKitManager *(^js_color)(UIColor *);
typedef JSKitManager *(^js_textFont)(UIFont *);
typedef JSKitManager *(^js_textAlignment)(NSTextAlignment);
typedef JSKitManager *(^js_attributedString)(NSMutableAttributedString *);

/*! lable attr */
typedef JSKitManager *(^js_lineBreakMode)(NSLineBreakMode);
typedef JSKitManager *(^js_baselineAdjustment)(UIBaselineAdjustment);
typedef JSKitManager *(^js_lableNumbOfLines)(NSInteger);

/*! image */
typedef JSKitManager *(^js_image)(UIImage *);
typedef JSKitManager *(^js_image_state)(UIImage *, UIControlState);

/*! view */
typedef JSKitManager *(^js_view)(UIView *);
typedef JSKitManager *(^js_tintAdjustmentMode)(UIViewTintAdjustmentMode );
typedef JSKitManager *(^js_shadow)(CGSize offset, CGFloat opacity, CGFloat radius);
typedef JSKitManager *(^js_cornerRadiusShadow)(CGFloat cornerRadius, CGSize offset, CGFloat opacity, CGFloat radius);
typedef JSKitManager *(^js_border)(UIColor *borderColor, CGFloat borderWidth, CGFloat radius);

/*! TF or tv */
typedef JSKitManager *(^js_placeHold)(NSString *);




/*! 数据类型 */
typedef JSKitManager *(^js_void)(void);
typedef JSKitManager *(^js_float)(CGFloat);
typedef JSKitManager *(^js_bool)(BOOL);
typedef JSKitManager *(^js_bool_bool)(BOOL, BOOL);
typedef JSKitManager *(^js_float_bool)(CGFloat, BOOL);
typedef JSKitManager *(^js_point_bool)(CGPoint, BOOL);
typedef JSKitManager *(^js_integer)(NSInteger);
typedef JSKitManager *(^js_uinteger)(NSUInteger);

/*! size */
typedef JSKitManager *(^js_edgeInsets)(UIEdgeInsets);
typedef JSKitManager *(^js_rect)(CGFloat x,CGFloat y,CGFloat w,CGFloat h);
typedef JSKitManager *(^js_point)(CGPoint);
typedef JSKitManager *(^js_size)(CGSize);
typedef JSKitManager *(^js_range)(NSRange);
typedef JSKitManager *(^js_transform)(CGAffineTransform transform);
typedef JSKitManager *(^js_contentMode)(UIViewContentMode);


@interface JSKitManager : NSObject

/* category use,overlook */
@property (nonatomic, weak) id main;           //clear is UIControl or UIView
@property (nonatomic, strong) id originalVar;  // 用于记录调用mark时当前值 

@property (nonatomic, weak) __kindof YYLabel *js_YYlabel;
@property (nonatomic, weak) __kindof UILabel *js_UIlabel;
@property (nonatomic, weak) __kindof NSMutableAttributedString *js_AttriStr;


@end
